Exploration into the Emissions Trends of Countries, OPEC and OPEC Plus Members, World Bank Zero Routine Flaring Endorsers and the Relationship Between Emissions and MacroEconomic Factors

  • By Clifford Okwudili Aniakor
  • Date: 15th October 2022

Introduction

The data was derived from "Our World in Data" website. Its is basically worldwide emissions data. The columns contained include:

  • country: the name of country, could also include continents, regions and other classification
  • year: year for recorded emissions
  • iso_code: iso codes of the countries
  • population: population in the given year
  • gdp: gross domestic product
  • cement_co2: CO2 emissions from the cement industry
  • cement_co2_per_capita: Cement CO2 emissions per capita - co2: Carbon(iv)oxide emissions
  • co2_growth_abs: Absolute change in CO2 emissions, - - - co2_growth_prct: Percentage change in CO2 emissions,
  • co2_per_capita: Carbon(iv)oxide emissions per capita
  • co2_per_gdp:Carbon(iv)oxide emissions per GDP , - - - - co2_per_unit_energy: Carbon(iv)oxide emissions per energy
  • coal_co2: Carbon(iv)oxide emissions from the coal industry
  • coal_co2_per_capita: Coal Carbon(iv)oxide emissions per capita
  • consumption_co2: Energy consumption co2 emissions
  • consumption_co2_per_capita: Energy consumption co2 emissions per capita
  • consumption_co2_per_gdp: Energy consumption co2 emissions per GDP
  • cumulative_cement_co2: Cumulative CO2 from Cement Industry
  • cumulative_co2: Cumulative CO2 emissions
  • cumulative_coal_co2: Cumulative CO2 emissions from the Coal Industry
  • cumulative_flaring_co2: Cumulative flaring CO2 emissions
  • cumulative_gas_co2: Cumulative CO2 emissions from the gas industry
  • cumulative_oil_co2: Cumulative CO2 emissions from the oil industry
  • cumulative_other_co2: Cumulative CO2 emissions from other industries
  • energy_per_capita: Energy per capita
  • energy_per_gdp: Energy per GDP
  • flaring_co2: Flaring CO2 Emissions
  • flaring_co2_per_capita: Flaring CO2 Emissions per capita
  • gas_co2: CO2 Emissions from the Gas Industry
  • gas_co2_per_capita: CO2 Emission form the Gas Industry per capita
  • ghg_excluding_lucf_per_capita: GHG per capita excluding Land-use Change and Forestry
  • ghg_per_capita: GHG emissions per capita
  • methane: Methane emissions
  • methane_per_capita: Methane emissions per capita
  • nitrous_oxide: Nitrous oxide emissions
  • nitrous_oxide_per_capita: Nitrous oxide emissions per capita
  • oil_co2: Carbon(iv)oxide from the oil industry
  • oil_co2_per_capita:Carbon(iv)oxide from the oil industry per capita
  • other_co2_per_capita: Other carbon(iv)oxide emissions per capita
  • other_industry_co2: carbon(iv)oxide emissions from other industries
  • primary_energy_consumption: primary energy consumption
  • share_global_cement_co2: Share of global cement industry CO2 emissions
  • share_global_co2: Share of global CO2 emissions
  • share_global_coal_co2: Share of global coal Industry CO2 Industry
  • share_global_cumulative_cement_co2: Share of cumulative cement industry co2 emissions
  • share_global_cumulative_co2: Share of global cumulative CO2 emissions
  • share_global_cumulative_coal_co2: Share of global coal industry cumulative co2 emissions
  • share_global_cumulative_flaring_co2: Share of global flaring cumulative CO2 emissions
  • share_global_cumulative_gas_co2: Share of global gas industry cumulative co2 emissions
  • share_global_cumulative_oil_co2: Share of global oil industry cumulative co2 emissions
  • share_global_cumulative_other_co2: Share of other industries' cumulative co2 emissions
  • share_global_flaring_co2: Share of global flaring CO2 emissions
  • share_global_gas_co2: Share of global gas industry's CO2 emissions
  • share_global_oil_co2: Share of global oil industry's CO2 emissions
  • share_global_other_co2: Share of other industries' global CO2 emissions
  • total_ghg:Total GHG emissions
  • total_ghg_excluding_lucf: Total GHG emissions excluding land use change and foresty
  • trade_co2: CO2 emissions from trading
  • trade_co2_share: Trade CO2 share by country Our_World_in_Data_logo.png
In [4]:
#install packages
! pip install --upgrade pandas
! pip install chart-studio
! pip install --upgrade plotly
! pip install -U kaleido
Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/
Requirement already satisfied: pandas in /usr/local/lib/python3.7/dist-packages (1.3.5)
Requirement already satisfied: pytz>=2017.3 in /usr/local/lib/python3.7/dist-packages (from pandas) (2022.4)
Requirement already satisfied: numpy>=1.17.3 in /usr/local/lib/python3.7/dist-packages (from pandas) (1.21.6)
Requirement already satisfied: python-dateutil>=2.7.3 in /usr/local/lib/python3.7/dist-packages (from pandas) (2.8.2)
Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.7/dist-packages (from python-dateutil>=2.7.3->pandas) (1.15.0)
Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/
Requirement already satisfied: chart-studio in /usr/local/lib/python3.7/dist-packages (1.1.0)
Requirement already satisfied: retrying>=1.3.3 in /usr/local/lib/python3.7/dist-packages (from chart-studio) (1.3.3)
Requirement already satisfied: plotly in /usr/local/lib/python3.7/dist-packages (from chart-studio) (5.10.0)
Requirement already satisfied: requests in /usr/local/lib/python3.7/dist-packages (from chart-studio) (2.23.0)
Requirement already satisfied: six in /usr/local/lib/python3.7/dist-packages (from chart-studio) (1.15.0)
Requirement already satisfied: tenacity>=6.2.0 in /usr/local/lib/python3.7/dist-packages (from plotly->chart-studio) (8.1.0)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /usr/local/lib/python3.7/dist-packages (from requests->chart-studio) (1.24.3)
Requirement already satisfied: idna<3,>=2.5 in /usr/local/lib/python3.7/dist-packages (from requests->chart-studio) (2.10)
Requirement already satisfied: chardet<4,>=3.0.2 in /usr/local/lib/python3.7/dist-packages (from requests->chart-studio) (3.0.4)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.7/dist-packages (from requests->chart-studio) (2022.9.24)
Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/
Requirement already satisfied: plotly in /usr/local/lib/python3.7/dist-packages (5.10.0)
Requirement already satisfied: tenacity>=6.2.0 in /usr/local/lib/python3.7/dist-packages (from plotly) (8.1.0)
Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/
Requirement already satisfied: kaleido in /usr/local/lib/python3.7/dist-packages (0.2.1)
In [5]:
#load packages
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import kaleido
import plotly.graph_objects as go
import plotly.express as px
from plotly.offline import plot, iplot
from plotly.subplots import make_subplots
import plotly.io as pio
pio.renderers.default = "svg"
%matplotlib inline
In [6]:
#load csv file
world=pd.read_csv("owid-co2-data.txt")
world
Out[6]:
country year iso_code population gdp cement_co2 cement_co2_per_capita co2 co2_growth_abs co2_growth_prct ... share_global_cumulative_oil_co2 share_global_cumulative_other_co2 share_global_flaring_co2 share_global_gas_co2 share_global_oil_co2 share_global_other_co2 total_ghg total_ghg_excluding_lucf trade_co2 trade_co2_share
0 Afghanistan 1949 AFG 7624058.0 NaN NaN NaN 0.015 NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
1 Afghanistan 1950 AFG 7752117.0 9.421400e+09 NaN NaN 0.084 0.070 475.00 ... 0.00 NaN NaN NaN 0.00 NaN NaN NaN NaN NaN
2 Afghanistan 1951 AFG 7840151.0 9.692280e+09 NaN NaN 0.092 0.007 8.70 ... 0.00 NaN NaN NaN 0.00 NaN NaN NaN NaN NaN
3 Afghanistan 1952 AFG 7935996.0 1.001733e+10 NaN NaN 0.092 0.000 0.00 ... 0.00 NaN NaN NaN 0.00 NaN NaN NaN NaN NaN
4 Afghanistan 1953 AFG 8039684.0 1.063052e+10 NaN NaN 0.106 0.015 16.00 ... 0.00 NaN NaN NaN 0.00 NaN NaN NaN NaN NaN
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
26003 Zimbabwe 2016 ZWE 14030338.0 2.096179e+10 0.639 0.046 10.738 -1.488 -12.17 ... 0.02 NaN NaN NaN 0.03 NaN 115.92 28.53 1.415 13.18
26004 Zimbabwe 2017 ZWE 14236599.0 2.194784e+10 0.678 0.048 9.582 -1.156 -10.77 ... 0.02 NaN NaN NaN 0.03 NaN 115.59 28.30 1.666 17.39
26005 Zimbabwe 2018 ZWE 14438812.0 2.271535e+10 0.697 0.048 11.854 2.273 23.72 ... 0.02 NaN NaN NaN 0.03 NaN 118.22 30.83 1.308 11.04
26006 Zimbabwe 2019 ZWE 14645473.0 NaN 0.697 0.048 10.949 -0.905 -7.64 ... 0.02 NaN NaN NaN 0.03 NaN 117.96 30.53 1.473 13.45
26007 Zimbabwe 2020 ZWE 14862927.0 NaN 0.697 0.047 10.531 -0.418 -3.82 ... 0.03 NaN NaN NaN 0.03 NaN NaN NaN NaN NaN

26008 rows × 60 columns

In [7]:
#the dimensions
world.shape
Out[7]:
(26008, 60)
In [8]:
world.info()
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 26008 entries, 0 to 26007
Data columns (total 60 columns):
 #   Column                               Non-Null Count  Dtype  
---  ------                               --------------  -----  
 0   country                              26008 non-null  object 
 1   year                                 26008 non-null  int64  
 2   iso_code                             21913 non-null  object 
 3   population                           23878 non-null  float64
 4   gdp                                  13479 non-null  float64
 5   cement_co2                           12668 non-null  float64
 6   cement_co2_per_capita                12638 non-null  float64
 7   co2                                  24670 non-null  float64
 8   co2_growth_abs                       24294 non-null  float64
 9   co2_growth_prct                      25696 non-null  float64
 10  co2_per_capita                       24032 non-null  float64
 11  co2_per_gdp                          15851 non-null  float64
 12  co2_per_unit_energy                  9958 non-null   float64
 13  coal_co2                             17909 non-null  float64
 14  coal_co2_per_capita                  17536 non-null  float64
 15  consumption_co2                      4096 non-null   float64
 16  consumption_co2_per_capita           4096 non-null   float64
 17  consumption_co2_per_gdp              3877 non-null   float64
 18  cumulative_cement_co2                12668 non-null  float64
 19  cumulative_co2                       24670 non-null  float64
 20  cumulative_coal_co2                  17909 non-null  float64
 21  cumulative_flaring_co2               4641 non-null   float64
 22  cumulative_gas_co2                   9245 non-null   float64
 23  cumulative_oil_co2                   21100 non-null  float64
 24  cumulative_other_co2                 2208 non-null   float64
 25  energy_per_capita                    9773 non-null   float64
 26  energy_per_gdp                       7159 non-null   float64
 27  flaring_co2                          4641 non-null   float64
 28  flaring_co2_per_capita               4640 non-null   float64
 29  gas_co2                              9245 non-null   float64
 30  gas_co2_per_capita                   9235 non-null   float64
 31  ghg_excluding_lucf_per_capita        6149 non-null   float64
 32  ghg_per_capita                       6149 non-null   float64
 33  methane                              6150 non-null   float64
 34  methane_per_capita                   6150 non-null   float64
 35  nitrous_oxide                        6150 non-null   float64
 36  nitrous_oxide_per_capita             6150 non-null   float64
 37  oil_co2                              21100 non-null  float64
 38  oil_co2_per_capita                   20791 non-null  float64
 39  other_co2_per_capita                 2208 non-null   float64
 40  other_industry_co2                   2208 non-null   float64
 41  primary_energy_consumption           9825 non-null   float64
 42  share_global_cement_co2              12668 non-null  float64
 43  share_global_co2                     24670 non-null  float64
 44  share_global_coal_co2                17909 non-null  float64
 45  share_global_cumulative_cement_co2   12668 non-null  float64
 46  share_global_cumulative_co2          24670 non-null  float64
 47  share_global_cumulative_coal_co2     17909 non-null  float64
 48  share_global_cumulative_flaring_co2  4641 non-null   float64
 49  share_global_cumulative_gas_co2      9245 non-null   float64
 50  share_global_cumulative_oil_co2      21100 non-null  float64
 51  share_global_cumulative_other_co2    2208 non-null   float64
 52  share_global_flaring_co2             4641 non-null   float64
 53  share_global_gas_co2                 9245 non-null   float64
 54  share_global_oil_co2                 21100 non-null  float64
 55  share_global_other_co2               2208 non-null   float64
 56  total_ghg                            6149 non-null   float64
 57  total_ghg_excluding_lucf             6149 non-null   float64
 58  trade_co2                            4096 non-null   float64
 59  trade_co2_share                      4096 non-null   float64
dtypes: float64(57), int64(1), object(2)
memory usage: 11.9+ MB
In [9]:
world.columns
Out[9]:
Index(['country', 'year', 'iso_code', 'population', 'gdp', 'cement_co2',
       'cement_co2_per_capita', 'co2', 'co2_growth_abs', 'co2_growth_prct',
       'co2_per_capita', 'co2_per_gdp', 'co2_per_unit_energy', 'coal_co2',
       'coal_co2_per_capita', 'consumption_co2', 'consumption_co2_per_capita',
       'consumption_co2_per_gdp', 'cumulative_cement_co2', 'cumulative_co2',
       'cumulative_coal_co2', 'cumulative_flaring_co2', 'cumulative_gas_co2',
       'cumulative_oil_co2', 'cumulative_other_co2', 'energy_per_capita',
       'energy_per_gdp', 'flaring_co2', 'flaring_co2_per_capita', 'gas_co2',
       'gas_co2_per_capita', 'ghg_excluding_lucf_per_capita', 'ghg_per_capita',
       'methane', 'methane_per_capita', 'nitrous_oxide',
       'nitrous_oxide_per_capita', 'oil_co2', 'oil_co2_per_capita',
       'other_co2_per_capita', 'other_industry_co2',
       'primary_energy_consumption', 'share_global_cement_co2',
       'share_global_co2', 'share_global_coal_co2',
       'share_global_cumulative_cement_co2', 'share_global_cumulative_co2',
       'share_global_cumulative_coal_co2',
       'share_global_cumulative_flaring_co2',
       'share_global_cumulative_gas_co2', 'share_global_cumulative_oil_co2',
       'share_global_cumulative_other_co2', 'share_global_flaring_co2',
       'share_global_gas_co2', 'share_global_oil_co2',
       'share_global_other_co2', 'total_ghg', 'total_ghg_excluding_lucf',
       'trade_co2', 'trade_co2_share'],
      dtype='object')
In [10]:
world.dtypes
Out[10]:
country                                 object
year                                     int64
iso_code                                object
population                             float64
gdp                                    float64
cement_co2                             float64
cement_co2_per_capita                  float64
co2                                    float64
co2_growth_abs                         float64
co2_growth_prct                        float64
co2_per_capita                         float64
co2_per_gdp                            float64
co2_per_unit_energy                    float64
coal_co2                               float64
coal_co2_per_capita                    float64
consumption_co2                        float64
consumption_co2_per_capita             float64
consumption_co2_per_gdp                float64
cumulative_cement_co2                  float64
cumulative_co2                         float64
cumulative_coal_co2                    float64
cumulative_flaring_co2                 float64
cumulative_gas_co2                     float64
cumulative_oil_co2                     float64
cumulative_other_co2                   float64
energy_per_capita                      float64
energy_per_gdp                         float64
flaring_co2                            float64
flaring_co2_per_capita                 float64
gas_co2                                float64
gas_co2_per_capita                     float64
ghg_excluding_lucf_per_capita          float64
ghg_per_capita                         float64
methane                                float64
methane_per_capita                     float64
nitrous_oxide                          float64
nitrous_oxide_per_capita               float64
oil_co2                                float64
oil_co2_per_capita                     float64
other_co2_per_capita                   float64
other_industry_co2                     float64
primary_energy_consumption             float64
share_global_cement_co2                float64
share_global_co2                       float64
share_global_coal_co2                  float64
share_global_cumulative_cement_co2     float64
share_global_cumulative_co2            float64
share_global_cumulative_coal_co2       float64
share_global_cumulative_flaring_co2    float64
share_global_cumulative_gas_co2        float64
share_global_cumulative_oil_co2        float64
share_global_cumulative_other_co2      float64
share_global_flaring_co2               float64
share_global_gas_co2                   float64
share_global_oil_co2                   float64
share_global_other_co2                 float64
total_ghg                              float64
total_ghg_excluding_lucf               float64
trade_co2                              float64
trade_co2_share                        float64
dtype: object
In [11]:
world.country.unique()
Out[11]:
array(['Afghanistan', 'Africa', 'Albania', 'Algeria', 'Andorra', 'Angola',
       'Anguilla', 'Antarctica', 'Antigua and Barbuda', 'Argentina',
       'Armenia', 'Aruba', 'Asia', 'Asia (excl. China & India)',
       'Australia', 'Austria', 'Azerbaijan', 'Bahamas', 'Bahrain',
       'Bangladesh', 'Barbados', 'Belarus', 'Belgium', 'Belize', 'Benin',
       'Bermuda', 'Bhutan', 'Bolivia', 'Bonaire Sint Eustatius and Saba',
       'Bosnia and Herzegovina', 'Botswana', 'Brazil',
       'British Virgin Islands', 'Brunei', 'Bulgaria', 'Burkina Faso',
       'Burundi', 'Cambodia', 'Cameroon', 'Canada', 'Cape Verde',
       'Central African Republic', 'Chad', 'Chile', 'China',
       'Christmas Island', 'Colombia', 'Comoros', 'Congo', 'Cook Islands',
       'Costa Rica', "Cote d'Ivoire", 'Croatia', 'Cuba', 'Curacao',
       'Cyprus', 'Czechia', 'Democratic Republic of Congo', 'Denmark',
       'Djibouti', 'Dominica', 'Dominican Republic', 'Ecuador', 'Egypt',
       'El Salvador', 'Equatorial Guinea', 'Eritrea', 'Estonia',
       'Eswatini', 'Ethiopia', 'Europe', 'Europe (excl. EU-27)',
       'Europe (excl. EU-28)', 'European Union (27)',
       'European Union (28)', 'Faeroe Islands', 'Fiji', 'Finland',
       'France', 'French Equatorial Africa', 'French Guiana',
       'French Polynesia', 'French West Africa', 'Gabon', 'Gambia',
       'Georgia', 'Germany', 'Ghana', 'Greece', 'Greenland', 'Grenada',
       'Guadeloupe', 'Guatemala', 'Guinea', 'Guinea-Bissau', 'Guyana',
       'Haiti', 'High-income countries', 'Honduras', 'Hong Kong',
       'Hungary', 'Iceland', 'India', 'Indonesia',
       'International transport', 'Iran', 'Iraq', 'Ireland', 'Israel',
       'Italy', 'Jamaica', 'Japan', 'Jordan', 'Kazakhstan', 'Kenya',
       'Kiribati', 'Kosovo', 'Kuwait', 'Kuwaiti Oil Fires', 'Kyrgyzstan',
       'Laos', 'Latvia', 'Lebanon', 'Leeward Islands', 'Lesotho',
       'Liberia', 'Libya', 'Liechtenstein', 'Lithuania',
       'Low-income countries', 'Lower-middle-income countries',
       'Luxembourg', 'Macao', 'Madagascar', 'Malawi', 'Malaysia',
       'Maldives', 'Mali', 'Malta', 'Marshall Islands', 'Martinique',
       'Mauritania', 'Mauritius', 'Mayotte', 'Mexico',
       'Micronesia (country)', 'Moldova', 'Mongolia', 'Montenegro',
       'Montserrat', 'Morocco', 'Mozambique', 'Myanmar', 'Namibia',
       'Nauru', 'Nepal', 'Netherlands', 'New Caledonia', 'New Zealand',
       'Nicaragua', 'Niger', 'Nigeria', 'Niue', 'North America',
       'North America (excl. USA)', 'North Korea', 'North Macedonia',
       'Norway', 'Oceania', 'Oman', 'Pakistan', 'Palau', 'Palestine',
       'Panama', 'Panama Canal Zone', 'Papua New Guinea', 'Paraguay',
       'Peru', 'Philippines', 'Poland', 'Portugal', 'Puerto Rico',
       'Qatar', 'Reunion', 'Romania', 'Russia', 'Rwanda',
       'Ryukyu Islands', 'Saint Helena', 'Saint Kitts and Nevis',
       'Saint Lucia', 'Saint Pierre and Miquelon',
       'Saint Vincent and the Grenadines', 'Samoa',
       'Sao Tome and Principe', 'Saudi Arabia', 'Senegal', 'Serbia',
       'Seychelles', 'Sierra Leone', 'Singapore',
       'Sint Maarten (Dutch part)', 'Slovakia', 'Slovenia',
       'Solomon Islands', 'Somalia', 'South Africa', 'South America',
       'South Korea', 'South Sudan', 'Spain', 'Sri Lanka',
       'St. Kitts-Nevis-Anguilla', 'Sudan', 'Suriname', 'Sweden',
       'Switzerland', 'Syria', 'Taiwan', 'Tajikistan', 'Tanzania',
       'Thailand', 'Timor', 'Togo', 'Tonga', 'Trinidad and Tobago',
       'Tunisia', 'Turkey', 'Turkmenistan', 'Turks and Caicos Islands',
       'Tuvalu', 'Uganda', 'Ukraine', 'United Arab Emirates',
       'United Kingdom', 'United States', 'Upper-middle-income countries',
       'Uruguay', 'Uzbekistan', 'Vanuatu', 'Venezuela', 'Vietnam',
       'Wallis and Futuna', 'World', 'Yemen', 'Zambia', 'Zimbabwe'],
      dtype=object)

What's the Carbon(iv)oxide Emissions for the World and its Continents between 1750 to 2020?

In [12]:
world_cont=world.query("country=='Africa'|country=='Antarctica'|country=='Asia'|country=='South America'|country=='North America'|country=='Oceania'|country=='Europe'|country=='World'")
px.line(world_cont,x="year",y="co2",color="country",labels={'country':'Country','year':'Year','co2':'Carbon(iv)oxide'},width=950,height=900,
        title="<b>Carbon(iv)oxide emissions from 1750 to 2020 for Different Continents</b>")
17501800185019001950200005k10k15k20k25k30k35kCountryAfricaAntarcticaAsiaEuropeNorth AmericaOceaniaSouth AmericaWorldCarbon(iv)oxide emissions from 1750 to 2020 for Different ContinentsYearCarbon(iv)oxide

Asia started out as a low-emitting continent until 1950 when its CO2 emissions continued to rise progressively. By 1992, Asia exceeded Europe to become the highest CO2-emitting continent. North America exceeded Europe in 1994 to become the 2nd highest CO2-emitting continent. However, In 2020, Asia still had more than 3.5 times the emissions of North America. Africa and South America share a somewhat similar emissions pathway with Africa exceeding South America in 1981 and 2000. Oceania has maintained its low-emitting position alongside Antarctica. For the world, we see a progressive rise in emissions since the industrial revolution and the last peak in 2019.

What's the Carbon(iv)oxide Per Capita Emissions for the World and its Continents between 1800 to 2020?

In [13]:
world_cont2=world_cont[world_cont['year']>=1800]
px.line(world_cont2,x="year",y="co2_per_capita",color="country",labels={'country':'Country','year':'Year','co2_per_capita':'Carbon(iv)oxide per Capita'},width=950,height=900,
        title="<b>Carbon(iv)oxide per Capita emissions from 1800 to 2020 for Different Contintents</b>")
180018501900195020000246810121416CountryAfricaAntarcticaAsiaEuropeNorth AmericaOceaniaSouth AmericaWorldCarbon(iv)oxide per Capita emissions from 1800 to 2020 for Different ContintentsYearCarbon(iv)oxide per Capita

The continents' CO2 emissions per capita tell a different story. North Americans have the highest emitters since 1858 up until 2016 when Oceanians overtook its position. Oceania is a low-emitting continent, however, Oceanians are amongst the highest polluters. Europeans are the 3rd highest polluters followed by Asians. Africans and South Americans are the least contributors.

What is the Distribution of CO2 Emissions for Different Countries in 2020?

In [14]:
world_2020=world.query("year==2020")
In [37]:
fig = px.choropleth(world_2020, color="co2",
                    locations="iso_code",locationmode="ISO-3", scope="world",range_color=[0.007,11000],
                   hover_data=["country", "co2", "co2_per_gdp"],width=1000,
                  labels={'country':'Country','year':'Year','co2':'Carbon(iv)Oxide in Gigatonnes',
                          'co2_per_gdp':'Carbon(iv)Oxide Per GDP','iso_code':'ISO Code'},
        title="<b>Carbon(iv)oxide Emissions (Gigatonnes) for Different Countries in 2020</b>",
                    color_continuous_scale='reds')
fig.show()
02k4k6k8k10kCarbon(iv)Oxide in GigatonnesCarbon(iv)oxide Emissions (Gigatonnes) for Different Countries in 2020

What is the Distribution of CO2 Emissions for Different Countries in Different Years?

In [36]:
fig = px.choropleth(world, color="co2",
                    locations="iso_code",locationmode="ISO-3", scope="world",range_color=[0.007,11000],
                   hover_data=["country", "co2", "co2_per_gdp"],width=1000,
                  labels={'country':'Country','year':'Year','co2':'Carbon(iv)Oxide in Gigatonnes',
                          'co2_per_gdp':'Carbon(iv)Oxide Per GDP','iso_code':'ISO Code'},
        title="<b>Carbon(iv)oxide Emissions (Gigatonnes) for Different Countries in Different Years</b>",
        animation_frame="year", color_continuous_scale='reds')
fig.show()
Year=19491949196519811997201318921908192419401837185318691808182417901754177002k4k6k8k10kCarbon(iv)Oxide in GigatonnesCarbon(iv)oxide Emissions (Gigatonnes) for Different Countries in Different Years

China, United States and India were the top 3 CO2 emitters in 2020. Island countries namely Tuvalu, Saint Helena and Niue are the lowest emitters

What is the Distribution of CO2 Per Capita Emissions for Different Countries in 2020?

In [35]:
fig = px.choropleth(world_2020, color="co2_per_capita",
                    locations="iso_code",locationmode="ISO-3", scope="world",range_color=[0.020,37.1],
                   hover_data=["country", "co2_per_capita"],width=1000,
                  labels={'country':'Country','year':'Year','co2_per_capita':'Carbon(iv)Oxide Per Capita','iso_code':'ISO Code'},
        title="<b>Carbon(iv)oxide(tonne) Per Capita Different Countries in 2020</b>",
                  color_continuous_scale='ylorrd')
fig.show()
5101520253035Carbon(iv)Oxide Per CapitaCarbon(iv)oxide(tonne) Per Capita Different Countries in 2020

Qatar, New Caledonia and Mongolia have the top 3 highest CO2 emissions per capita. Democratic Republic of Congo, Somalia and the Central African Republic have the lowest CO2 emissions per capita.

How Much Has Each Country Contributed to Global Warming?

In [18]:
fig = px.choropleth(world_2020, color="cumulative_co2",
                    locations="iso_code",locationmode="ISO-3", scope="world",range_color=[0.260,417000],
                   hover_data=["country", "cumulative_co2"], width=1000,
                  labels={'country':'Country','year':'Year','cumulative_co2':'Cumulative Carbon(iv)Oxide (Gt)','iso_code':'ISO Code'},
        title="<b>Cumulative Carbon(iv)oxide Emissions in Gigatonnes from 1750 to 2020 for Different Countries</b>",
                  color_continuous_scale='ylorrd')
fig.show()
0100k200k300k400kCumulative Carbon(iv)Oxide (Gt)Cumulative Carbon(iv)oxide Emissions in Gigatonnes from 1750 to 2020 for Different Countries

The United States are the highest contributors of warming since 1750 followed by China and Russia.

In [19]:
#Select Data for OPEC Member-Countries Only
opec=world.query("(country=='Algeria'|country=='Angola'|country=='Congo'|country=='Equatorial Guinea'|country=='Gabon'|country=='Iran'|country=='Iraq'|country=='Kuwait'|country=='Libya'|country=='Nigeria'|country=='Saudi Arabia'|country=='United Arab Emirates'|country=='Venezuela') & (year==2015|year==2020)")
opecs=opec.copy()
opecs['hc_co2']=opecs.gas_co2+opecs.oil_co2
opecs=opecs[['year','country','hc_co2']]
#assign new columns for each year
opecs= pd.pivot_table(opecs, index = 'country', columns = 'year', values = 'hc_co2' ).reset_index()
opecs
#find the change in co2
opecs['change in co2'] = opecs[2020] - opecs[2015]
#positive change=increase, negative change=decrease
bins = [opecs['change in co2'].min()-1, 0,opecs['change in co2'].max()+1]
labels = ['decrease', 'increase']
opecs['direction'] = pd.cut(opecs['change in co2'], bins=bins, labels=labels)
opecs['percent change']=(((opecs[2015]-opecs[2020])/opecs[2015])*100)
opecs
Out[19]:
year country 2015 2020 change in co2 direction percent change
0 Algeria 134.359 137.549 3.190 increase -2.374236
1 Angola 18.131 12.394 -5.737 decrease 31.641939
2 Congo 3.180 2.668 -0.512 decrease 16.100629
3 Equatorial Guinea 5.987 4.447 -1.540 decrease 25.722399
4 Gabon 3.467 2.481 -0.986 decrease 28.439573
5 Iran 575.666 655.819 80.153 increase -13.923525
6 Iraq 134.058 175.021 40.963 increase -30.556177
7 Kuwait 88.537 85.634 -2.903 decrease 3.278855
8 Libya 47.705 40.796 -6.909 decrease 14.482759
9 Nigeria 86.573 101.871 15.298 increase -17.670636
10 Saudi Arabia 645.132 599.819 -45.313 decrease 7.023834
11 United Arab Emirates 200.915 130.602 -70.313 decrease 34.996392
12 Venezuela 144.574 52.788 -91.786 decrease 63.487211
In [20]:
#plot the points
fig = px.scatter(opecs, x=[2015,2020], y="country", color_discrete_map= {'2020': 'red', '2015': 'green' },hover_name = 'country',width=1300,
                 height=1000,labels={'value':'Fossil Carbondioxide Emissions in 2015 and 2020','country':'Country'})
fig.update(layout_showlegend=False)
# iterate on each country
for i in opecs["country"]:
    # filter by country
    opec_country = opecs[opecs["country"] == i]
    
    fig.add_shape(
        type="line", opacity = 0.8,
        layer="below",
        # add connectors
        y0=opec_country.country.values[0], x0=opec_country[2015].values[0],
        y1=opec_country.country.values[0], x1=opec_country[2020].values[0], 
        line=dict(color="black",width=1)
    )
    fig.update_traces(marker=dict(size=10, opacity = 0.9)) 
fig.update_layout(width=970, height=1000,
     xaxis=dict(showgrid=True), 
     yaxis=dict(showgrid=False),
     title = "<b>Comparison of Fossil CO2 Emissions Generated by OPEC-Member Countries in 2015 and 2020</b>"
)
#specify the hover template
fig.update_traces(
    hovertemplate="<br>".join([
        "<b>%{y}</b>",
        "Carbon(iv)oxide released from oil and gas : %{x}"]))
#render plot
fig.show()
0100200300400500600AlgeriaAngolaCongoEquatorial GuineaGabonIranIraqKuwaitLibyaNigeriaSaudi ArabiaUnited Arab EmiratesVenezuelaComparison of Fossil CO2 Emissions Generated by OPEC-Member Countries in 2015 and 2020Fossil Carbondioxide Emissions in 2015 and 2020Country

Since COP 26, the oil and gas CO2 emissions of Algeria,Iran, Iraq and Nigeria have increased. With Iraq recording the highest increase. Angola, Congo, Equatorial Guinea, Gabon, Kuwait, Libya, Saudi Arabia, United Arab Emirates, Venezuela saw a reduction in oil and gas CO2 emissions. Venezuela recorded the highest decrease in oil and gas co2 emissions.

In [21]:
#Select Data for OPEC Member-Countries Only
opeccs=world.query("(country=='Algeria'|country=='Angola'|country=='Congo'|country=='Equatorial Guinea'|country=='Gabon'|country=='Iran'|country=='Iraq'|country=='Kuwait'|country=='Libya'|country=='Nigeria'|country=='Saudi Arabia'|country=='United Arab Emirates'|country=='Venezuela') & (year==2015|year==2020)")
opecss=opeccs.copy()
opecss['hc_co2']=opecss.gas_co2_per_capita+opecss.oil_co2_per_capita
opecss=opecss[['year','country','hc_co2']]
#assign new columns for each year
opecss= pd.pivot_table(opecss, index = 'country', columns = 'year', values = 'hc_co2' ).reset_index()
opecss
#find the change in renewable electricity generation
opecss['change in co2 per capita'] = opecss[2020] - opecss[2015]
#positive change=increase, negative change=decrease
bins = [opecss['change in co2 per capita'].min()-1, 0,opecss['change in co2 per capita'].max()+1]
labels = ['decrease', 'increase']
opecss['direction'] = pd.cut(opecss['change in co2 per capita'], bins=bins, labels=labels)
opecss['percent change']=(((opecss[2015]-opecss[2020])/opecss[2015])*100)
opecss
Out[21]:
year country 2015 2020 change in co2 per capita direction percent change
0 Algeria 3.382 3.137 -0.245 decrease 7.244234
1 Angola 0.651 0.377 -0.274 decrease 42.089094
2 Congo 0.655 0.483 -0.172 decrease 26.259542
3 Equatorial Guinea 5.124 3.170 -1.954 decrease 38.134270
4 Gabon 1.780 1.115 -0.665 decrease 37.359551
5 Iran 7.334 7.808 0.474 increase -6.463049
6 Iraq 3.769 4.352 0.583 increase -15.468294
7 Kuwait 23.083 20.052 -3.031 decrease 13.130876
8 Libya 7.433 5.937 -1.496 decrease 20.126463
9 Nigeria 0.478 0.494 0.016 increase -3.347280
10 Saudi Arabia 20.340 17.229 -3.111 decrease 15.294985
11 United Arab Emirates 21.690 13.205 -8.485 decrease 39.119410
12 Venezuela 4.806 1.857 -2.949 decrease 61.360799
In [22]:
#plot the points
fig = px.scatter(opecss, x=[2015,2020], y="country", color_discrete_map= {'2020': 'red', '2015': 'green' },hover_name = 'country',width=1300,
                 height=1000,labels={'value':'Fossil Carbondioxide per Capita Emissions in 2015 and 2020','country':'Country'})
fig.update(layout_showlegend=False)

# iterate on each country
for i in opecss["country"]:
    # filter by country
    opec_countryy = opecss[opecss["country"] == i]
    
    fig.add_shape(
        type="line", opacity = 0.8,
        layer="below",
        # add connectors
        y0=opec_countryy.country.values[0], x0=opec_countryy[2015].values[0],
        y1=opec_countryy.country.values[0], x1=opec_countryy[2020].values[0], 
        line=dict(color="black",width=1)
    )
    fig.update_traces(marker=dict(size=10, opacity = 0.9)) 
fig.update_layout(width=970, height=1000,
     xaxis=dict(showgrid=True), 
     yaxis=dict(showgrid=False),
     title = "<b>Comparison of OPEC-Member Countries Carbondioxide per Capita Emissions in 2015 and 2020</b>"
)
#specify the hover template
fig.update_traces(
    hovertemplate="<br>".join([
        "<b>%{y}</b>",
        "Oil and Gas Carbon(iv)oxide per Capita: %{x}"]))
#render plot
fig.show()
05101520AlgeriaAngolaCongoEquatorial GuineaGabonIranIraqKuwaitLibyaNigeriaSaudi ArabiaUnited Arab EmiratesVenezuelaComparison of OPEC-Member Countries Carbondioxide per Capita Emissions in 2015 and 2020Fossil Carbondioxide per Capita Emissions in 2015 and 2020Country

Iran, Iraq and Nigeria all increased their per capita oil and gas emissions despite the Paris Agreement goals. Iraq had the highest increase fossil CO2 per capita emissions. Algeria, Angola, Congo, Equatorial Guinea, Gabon, Kuwait, Libya, Saudi Arabia, United Arab Emirates, Venezuela decreased their fossil per capita emissions. Venezuela also recorded the highest reduction in oil and gas per capita emissions.

In [23]:
# Select Data for OPEC Plus Member-Countries Only
opec_plus=world.query("(country=='Azerbaijan'|country=='Bahrain'|country=='Brunei'|country=='Kazakhstan'|country=='Malaysia'|country=='Mexico'|country=='Oman'|country=='Russia'|country=='Sudan'|country=='South Sudan') & (year==2015|year==2020)")
opecc_plus=opec_plus.copy()
opecc_plus.fillna(0, inplace=True)
opecc_plus['hc_co2']=opecc_plus.gas_co2+opecc_plus.oil_co2
opecc_plus=opecc_plus[['year','country','hc_co2']]
#assign new columns for each year
opecc_plus= pd.pivot_table(opecc_plus, index = 'country', columns = 'year', values = 'hc_co2' ).reset_index()
opecc_plus
#find the change in co2
opecc_plus['change in co2'] = opecc_plus[2020] - opecc_plus[2015]
#positive change=increase, negative change=decrease
bins = [opecc_plus['change in co2'].min()-1, 0,opecc_plus['change in co2'].max()+1]
labels = ['decrease', 'increase']
opecc_plus['direction'] = pd.cut(opecc_plus['change in co2'], bins=bins, labels=labels)
opecc_plus['percent change']=(((opecc_plus[2015]-opecc_plus[2020])/opecc_plus[2015])*100)
opecc_plus['direction color'] = opecc_plus['direction'].replace('increase', '#f15656' ).replace('decrease', '#1a9d41')
opecc_plus
Out[23]:
year country 2015 2020 change in co2 direction percent change direction color
0 Azerbaijan 33.453 33.966 0.513 increase -1.533495 #f15656
1 Bahrain 32.016 34.436 2.420 increase -7.558721 #f15656
2 Brunei 6.536 9.496 2.960 increase -45.287638 #f15656
3 Kazakhstan 94.906 98.305 3.399 increase -3.581438 #f15656
4 Malaysia 153.400 149.069 -4.331 decrease 2.823338 #1a9d41
5 Mexico 406.851 319.167 -87.684 decrease 21.551870 #1a9d41
6 Oman 57.257 57.007 -0.250 decrease 0.436628 #1a9d41
7 Russia 1144.914 1136.365 -8.549 decrease 0.746694 #1a9d41
8 South Sudan 1.913 1.179 -0.734 decrease 38.369054 #1a9d41
9 Sudan 18.727 17.304 -1.423 decrease 7.598654 #1a9d41
In [24]:
fig = go.Figure(go.Scatter(x = [0] * len(opecc_plus), y =opecc_plus[2015] ,  mode = 'lines+markers+text', showlegend = False, hovertext = opecc_plus['country'], name = 'Fossil CO2 Emissions in 2015',marker=dict(
            color='#3970e7', 
            size=10)
))
fig.add_trace(go.Scatter( x = [1] * len(opecc_plus), y = opecc_plus[2020], mode = 'lines+markers+text', showlegend = False, hovertext = opecc_plus['country'], name = 'Fossil CO2 Emissions in 2020',marker=dict(
            color='#3970e7',
            size=10)
))

#add the connectors
for y0, y1, c in zip(opecc_plus[2015], opecc_plus[2020], opecc_plus['direction color']):
    fig.add_shape(type='line', x0=0, x1=1, y0=y0, y1=y1, line=dict(
        color=c))
#Add text on top of the connectors
fig.add_annotation(x=0, y=opecc_plus[2015].max()+50,
            text="<b>Fossil CO2 Emissions in 2015</b>",
            showarrow=False,
            yshift=10, font = dict(color = 'black'))
fig.add_annotation(x=1, y=opecc_plus[2020].max()+50,
            text="<b>Fossil CO2 Emissions in 2020</b>",
            showarrow=False,
            yshift=10, font = dict(color = 'black'))

#Add the names of the countrys
for i in range(len(opecc_plus)):
    if i%2 == 1:
        fig.add_annotation(x = 0-0.03, y = opecc_plus.iloc[i][2015], xanchor = 'right', text = opecc_plus.iloc[i]['country'], showarrow = False)
    else:
        fig.add_annotation(x = 1+0.03, y = opecc_plus.iloc[i][2020], xanchor = 'left', text = opecc_plus.iloc[i]['country'], showarrow = False)
#specify the hover template
fig.update_traces(
    hovertemplate="<br>".join([
        "<b>%{x}</b>",
        "Fossil CO2 Emissions : %{y}"]))        

#adjust the titles and axes
fig.update_layout(title = "<b>Comparison of Fossil CO2 Emissions by OPEC Plus-Member Countries in 2015 and 2020</b>",width=970, height=1000)
fig.update_xaxes(showticklabels = False)
fig.show()
020040060080010001200Comparison of Fossil CO2 Emissions by OPEC Plus-Member Countries in 2015 and 2020Fossil CO2 Emissions in 2015Fossil CO2 Emissions in 2020AzerbaijanBahrainBruneiKazakhstanMalaysiaMexicoOmanRussiaSouth SudanSudan

Azerbaijan, Bahrain, Brunei and Kazakhstan all increased their oil and gas CO2 emissions compared to 2015 baseline. Brunei recorded the highest increase. Malaysia, Mexico, Oman, Russia and Sudan, South Sudan all recorded a reduction in oil and gas CO2 emissions. South Sudan recorded the highest reduction.

In [25]:
#Select Data for OPEC Member-Countries Only
opec_pluss=world.query("(country=='Azerbaijan'|country=='Bahrain'|country=='Brunei'|country=='Kazakhstan'|country=='Malaysia'|country=='Mexico'|country=='Oman'|country=='Russia'|country=='Sudan'|country=='South Sudan') & (year==2015|year==2020)")
opecc_pluss=opec_pluss.copy()
opecc_pluss.fillna(0, inplace=True)
opecc_pluss['hc_co2']=opecc_pluss.gas_co2_per_capita+opecc_pluss.oil_co2_per_capita
opecc_pluss=opecc_pluss[['year','country','hc_co2']]
#assign new columns for each year
opecc_pluss= pd.pivot_table(opecc_pluss, index = 'country', columns = 'year', values = 'hc_co2' ).reset_index()
opecc_pluss
#find the change in co2 per capita
opecc_pluss['change in co2 per capita'] = opecc_pluss[2020] - opecc_pluss[2015]
#positive change=increase, negative change=decrease
bins = [opecc_pluss['change in co2 per capita'].min()-1, 0,opecc_pluss['change in co2 per capita'].max()+1]
labels = ['decrease', 'increase']
opecc_pluss['direction'] = pd.cut(opecc_pluss['change in co2 per capita'], bins=bins, labels=labels)
opecc_pluss['percent change']=(((opecc_pluss[2015]-opecc_pluss[2020])/opecc_pluss[2015])*100)
opecc_pluss['direction color'] = opecc_pluss['direction'].replace('increase','#f15656').replace('decrease','#1a9d41')
opecc_pluss
Out[25]:
year country 2015 2020 change in co2 per capita direction percent change direction color
0 Azerbaijan 3.476 3.350 -0.126 decrease 3.624856 #1a9d41
1 Bahrain 23.338 20.237 -3.101 decrease 13.287343 #1a9d41
2 Brunei 15.754 21.704 5.950 increase -37.768186 #f15656
3 Kazakhstan 5.401 5.235 -0.166 decrease 3.073505 #1a9d41
4 Malaysia 5.068 4.606 -0.462 decrease 9.116022 #1a9d41
5 Mexico 3.338 2.476 -0.862 decrease 25.823847 #1a9d41
6 Oman 13.418 11.164 -2.254 decrease 16.798331 #1a9d41
7 Russia 7.896 7.787 -0.109 decrease 1.380446 #1a9d41
8 South Sudan 0.178 0.105 -0.073 decrease 41.011236 #1a9d41
9 Sudan 0.481 0.395 -0.086 decrease 17.879418 #1a9d41
In [26]:
fig = go.Figure(go.Scatter(x = [0] * len(opecc_pluss), y =opecc_pluss[2015] ,  mode = 'lines+markers+text', showlegend = False, hovertext = opecc_pluss['country'], name = 'Fossil CO2 per Capita Emissions in 2015',marker=dict(
            color='#3970e7', 
            size=10)
))
fig.add_trace(go.Scatter( x = [1] * len(opecc_pluss), y = opecc_pluss[2020], mode = 'lines+markers+text', showlegend = False, hovertext = opecc_pluss['country'], name = 'Fossil CO2 per Capita Emissions in 2020',marker=dict(
            color='#3970e7',
            size=10)
))

#add the connectors
for y0, y1, c in zip(opecc_pluss[2015], opecc_pluss[2020], opecc_pluss['direction color']):
    fig.add_shape(type='line', x0=0, x1=1, y0=y0, y1=y1, line=dict(
        color=c))
#Add text on top of the connectors
fig.add_annotation(x=0, y=opecc_pluss[2015].max()+1,
            text="<b>Fossil CO2 per Capita in 2015</b>",
            showarrow=False,
            yshift=10, font = dict(color = 'black'))
fig.add_annotation(x=1, y=opecc_pluss[2020].max()+1,
            text="<b>Fossil CO2 per Capita in 2020</b>",
            showarrow=False,
            yshift=10, font = dict(color = 'black'))

#Add the names of the countrys
for i in range(len(opecc_pluss)):
    if i%2 == 1:
        fig.add_annotation(x = 0-0.03, y = opecc_pluss.iloc[i][2015], xanchor = 'right', text = opecc_pluss.iloc[i]['country'], showarrow = False)
    else:
        fig.add_annotation(x = 1+0.03, y = opecc_pluss.iloc[i][2020], xanchor = 'left', text = opecc_pluss.iloc[i]['country'], showarrow = False)
#specify the hover template
fig.update_traces(
    hovertemplate="<br>".join([
        "<b>%{x}</b>",
        "Fossil CO2 per Capita Emisssions : %{y}"]))        

#adjust the titles and axes
fig.update_layout(title = "<b>Comparison of Fossil CO2 per Capita Emissions of OPEC plus Member Countries in 2015 and 2020</b>",width=970, height=1000)
fig.update_xaxes(showticklabels = False)
fig.show()
05101520Comparison of Fossil CO2 per Capita Emissions of OPEC plus Member Countries in 2015 and 2020Fossil CO2 per Capita in 2015Fossil CO2 per Capita in 2020AzerbaijanBahrainBruneiKazakhstanMalaysiaMexicoOmanRussiaSouth SudanSudan

Brunei was the only OPEC-Plus member to record an increase in oil and gas CO2 per capita emissions. Malaysia, Mexico, Oman, Russia and Sudan, South Sudan, Azerbaijan, Bahrain, and Kazakhstan all decreased their oil and gas CO2 per capita emissions. South Sudan also recorded the highest reduction here.

Since the Adoption of the Paris Agreement, How Has Flaring CO2 Emissions Changed for the World Bank Zero Routine Flaring Endorsers?

In [27]:
#Select Data for ZRF Endorsers Only
zrff=world.query("(country=='Angola'|country=='Azerbaijan'|country=='Bahrain'|country=='United countrys'|country=='Cameroon'|country=='Democratic Republic of Congo'|country=='Denmark'|country=='Ecuador'|country=='Egypt'|country=='France'|country=='Gabon'|country=='Germany'|country=='Indonesia'|country=='Iraq'|country=='Kazakhstan'|country=='Morocco'|country=='Mexico'|country=='Netherlands'|country=='New Zealand'|country=='Niger'|country=='Nigeria'|country=='Norway'|country=='Oman'|country=='Peru'|country=='Russia'|country=='Saudi Arabia'|country=='South Sudan'|country=='Turkmenistan'|country=='United Kingdom'|country=='Australia') & (year==2015|year==2020)")
zrf=zrff.copy()
zrf=zrf[['year','country','flaring_co2']]
#assign new columns for each year
zrf= pd.pivot_table(zrf, index = 'country', columns = 'year', values = 'flaring_co2' ).reset_index()
zrf
#find the change in flaring CO2
zrf['change in flaring co2'] = zrf[2020] - zrf[2015]
#positive change=increase, negative change=decrease
bins = [zrf['change in flaring co2'].min()-1, 0,zrf['change in flaring co2'].max()+1]
labels = ['decrease', 'increase']
zrf['direction'] = pd.cut(zrf['change in flaring co2'], bins=bins, labels=labels)
zrf['percent change']=(((zrf[2015]-zrf[2020])/zrf[2015])*100)
zrf
Out[27]:
year country 2015 2020 change in flaring co2 direction percent change
0 Angola 13.459 7.867 -5.592 decrease 41.548406
1 Australia 10.877 20.341 9.464 increase -87.009286
2 Azerbaijan 2.682 2.667 -0.015 decrease 0.559284
3 Denmark 0.247 0.195 -0.052 decrease 21.052632
4 Ecuador 1.337 1.246 -0.091 decrease 6.806283
5 France 2.857 2.529 -0.328 decrease 11.480574
6 Gabon 1.726 1.627 -0.099 decrease 5.735805
7 Germany 2.374 2.017 -0.357 decrease 15.037911
8 Indonesia 15.495 11.091 -4.404 decrease 28.422072
9 Iraq 28.096 32.316 4.220 increase -15.019932
10 Kazakhstan 16.101 14.622 -1.479 decrease 9.185765
11 Mexico 11.849 NaN NaN NaN NaN
12 Netherlands 1.037 1.049 0.012 increase -1.157184
13 New Zealand 1.377 1.021 -0.356 decrease 25.853304
14 Nigeria 18.635 15.348 -3.287 decrease 17.638852
15 Norway 2.545 1.676 -0.869 decrease 34.145383
16 Oman 2.748 3.059 0.311 increase -11.317322
17 Peru 0.264 0.202 -0.062 decrease 23.484848
18 Russia 25.537 46.762 21.225 increase -83.114696
19 Saudi Arabia 0.077 0.095 0.018 increase -23.376623
20 United Kingdom 4.606 4.504 -0.102 decrease 2.214503
In [28]:
#plot the points
fig = px.scatter(zrf, x=[2015,2020], y="country", color_discrete_map= {'2020': 'red', '2015': 'green' },hover_name = 'country',width=1300,
                 height=1000,labels={'value':'Flaring CO2 Emissions in 2015 and 2020','country':'Country'})
fig.update(layout_showlegend=False)

# iterate on each country
for i in zrf["country"]:
    # filter by country
    zrf_country = zrf[zrf["country"] == i]
    
    fig.add_shape(
        type="line", opacity = 0.8,
        layer="below",
        # add connectors
        y0=zrf_country.country.values[0], x0=zrf_country[2015].values[0],
        y1=zrf_country.country.values[0], x1=zrf_country[2020].values[0], 
        line=dict(color="black",width=1)
    )
    fig.update_traces(marker=dict(size=10, opacity = 0.9)) 
fig.update_layout(width=970, height=1000,
     xaxis=dict(showgrid=True), 
     yaxis=dict(showgrid=False),
     title = "<b>Comparison of Flaring CO2 Emissions by World Bank Zero Routine Flaring Endorsers in 2015 and 2020</b>"
)
#specify the hover template
fig.update_traces(
    hovertemplate="<br>".join([
        "<b>%{y}</b>",
        "Flaring Carbon(iv)oxide : %{x}"]))
#render plot
fig.show()
010203040AngolaAustraliaAzerbaijanDenmarkEcuadorFranceGabonGermanyIndonesiaIraqKazakhstanMexicoNetherlandsNew ZealandNigeriaNorwayOmanPeruRussiaSaudi ArabiaUnited KingdomComparison of Flaring CO2 Emissions by World Bank Zero Routine Flaring Endorsers in 2015 and 2020Flaring CO2 Emissions in 2015 and 2020Country

Australia, Iraq, Netherlands, Oman, Russia and Saudi Arabia all increased their flaring CO2 emissions compared to a 2015 baseline. Angola, Azerbaijan,Denmark, Ecuador, France, Gabon, Germany, Indonesia, Kazakhstan, New Zealand, Nigeria, Norway, Peru, United Kingdom all decreased their flaring-related CO2 emissions. There's missing flaring CO2 emissions data for other ZRF endorsers such as Bahrain, Cameroon, Democratic Republic of Congo, Egypt, Morocco, Niger, South Sudan, Turkmenistan and Mexico.

Since the Adoption of the Paris Agreement, How Has Methane Emissions Changed for the World Bank Zero Routine Flaring Endorsers?

In [29]:
#Select Data for ZRF Endorsers Only
zrf2=world.query("(country=='Angola'|country=='Azerbaijan'|country=='Bahrain'|country=='United countrys'|country=='Cameroon'|country=='Democratic Republic of Congo'|country=='Denmark'|country=='Ecuador'|country=='Egypt'|country=='France'|country=='Gabon'|country=='Germany'|country=='Indonesia'|country=='Iraq'|country=='Kazakhstan'|country=='Morocco'|country=='Mexico'|country=='Netherlands'|country=='New Zealand'|country=='Niger'|country=='Nigeria'|country=='Norway'|country=='Oman'|country=='Peru'|country=='Russia'|country=='Saudi Arabia'|country=='South Sudan'|country=='Turkmenistan'|country=='United Kingdom'|country=='Australia') & (year==2015|year==2019)")
zrf2=zrf2[['year','country','methane']]
#assign new columns for each year
zrf2= pd.pivot_table(zrf2, index = 'country', columns = 'year', values = 'methane').reset_index()
zrf2
#find the change in methane emissions
zrf2['change in methane'] = zrf2[2019] - zrf2[2015]
#positive change=increase, negative change=decrease
bins = [zrf2['change in methane'].min()-1, 0,zrf2['change in methane'].max()+1]
labels = ['decrease', 'increase']
zrf2['direction'] = pd.cut(zrf2['change in methane'], bins=bins, labels=labels)
zrf2['percent change']=(((zrf2[2015]-zrf2[2019])/zrf2[2015])*100)
zrf2
Out[29]:
year country 2015 2019 change in methane direction percent change
0 Angola 43.27 41.32 -1.95 decrease 4.506587
1 Australia 134.80 135.80 1.00 increase -0.741840
2 Azerbaijan 14.23 14.67 0.44 increase -3.092059
3 Bahrain 15.80 17.41 1.61 increase -10.189873
4 Cameroon 15.52 15.98 0.46 increase -2.963918
5 Democratic Republic of Congo 45.32 46.03 0.71 increase -1.566637
6 Denmark 8.20 7.78 -0.42 decrease 5.121951
7 Ecuador 27.06 27.18 0.12 increase -0.443459
8 Egypt 65.54 75.13 9.59 increase -14.632286
9 France 63.12 59.68 -3.44 decrease 5.449937
10 Gabon 6.23 5.89 -0.34 decrease 5.457464
11 Germany 52.72 48.71 -4.01 decrease 7.606222
12 Indonesia 403.76 381.62 -22.14 decrease 5.483456
13 Iraq 113.17 134.69 21.52 increase -19.015640
14 Kazakhstan 47.35 48.89 1.54 increase -3.252376
15 Mexico 137.97 140.01 2.04 increase -1.478582
16 Morocco 11.55 12.16 0.61 increase -5.281385
17 Netherlands 17.50 15.54 -1.96 decrease 11.200000
18 New Zealand 33.10 32.52 -0.58 decrease 1.752266
19 Niger 22.76 27.26 4.50 increase -19.771529
20 Nigeria 124.08 135.91 11.83 increase -9.534172
21 Norway 4.76 4.54 -0.22 decrease 4.621849
22 Oman 18.38 20.24 1.86 increase -10.119695
23 Peru 31.78 32.58 0.80 increase -2.517306
24 Russia 612.01 687.40 75.39 increase -12.318426
25 Saudi Arabia 106.61 110.25 3.64 increase -3.414314
26 South Sudan 31.91 30.42 -1.49 decrease 4.669383
27 Turkmenistan 77.78 80.48 2.70 increase -3.471329
28 United Kingdom 50.11 50.12 0.01 increase -0.019956
In [30]:
#plot the points
fig = px.scatter(zrf2, x=[2015,2019], y="country", color_discrete_map= {'2019': 'red', '2015': 'green' },hover_name = 'country',width=1300,
                 height=1000,labels={'value':'Methane Emissions by ZRF Endorsers in 2015 and 2019','country':'Country'})
fig.update(layout_showlegend=False)

# iterate on each country
for i in zrf2["country"]:
    # filter by country
    zrf2_countryy = zrf2[zrf2["country"] == i]
    
    fig.add_shape(
        type="line", opacity = 0.8,
        layer="below",
        # add connectors
        y0=zrf2_countryy.country.values[0], x0=zrf2_countryy[2015].values[0],
        y1=zrf2_countryy.country.values[0], x1=zrf2_countryy[2019].values[0], 
        line=dict(color="black",width=1)
    )
    fig.update_traces(marker=dict(size=10, opacity = 0.9)) 
fig.update_layout(width=970, height=1000,
     xaxis=dict(showgrid=True), 
     yaxis=dict(showgrid=False),
     title = "<b>Comparison of Methane Emissions by World Bank Zero Routine Flaring Endorsers 2015 and 2019</b>"
)
#specify the hover template
fig.update_traces(
    hovertemplate="<br>".join([
        "<b>%{y}</b>",
        "Methane Emissions : %{x}"]))
#render plot
fig.show()
0100200300400500600700AngolaAustraliaAzerbaijanBahrainCameroonDemocratic Republic of CongoDenmarkEcuadorEgyptFranceGabonGermanyIndonesiaIraqKazakhstanMexicoMoroccoNetherlandsNew ZealandNigerNigeriaNorwayOmanPeruRussiaSaudi ArabiaSouth SudanTurkmenistanUnited KingdomComparison of Methane Emissions by World Bank Zero Routine Flaring Endorsers 2015 and 2019Methane Emissions by ZRF Endorsers in 2015 and 2019Country

2019 was used sinced 2020 methane data wasn't available.Australia, Azerbaijan, Bahrain, Cameroon, Democratic Republic of Congo, Ecuador, Egypt, Iraq, Kazakhstan, Mexico, Morocco, Niger, Nigeria, Oman, Peru, Russia, Saudi Arabia, Turkmenistan and the United Kingdom saw an increase in methane emissions compared to 2015 vthreshold. Angola, Denmark, France, Gabon, Germany, Indonesia, Netherlands, New Zealand, Norway, South Sudan all saw a decrease in methane emissions compared to a 2015 baseline.

What's Relationship Between GHG Emissions and MacroEconomic Factors?

In [31]:
world_cond=world[['population','gdp','co2','cumulative_co2','methane','nitrous_oxide','primary_energy_consumption','total_ghg']]
world_cond=world_cond.rename(columns={'population':'Population','gdp':'GDP','co2':'Carbon(iv)oxide','cumulative_co2':'Cumulative Carbon(iv)oxide','methane':'Methane','nitrous_oxide':'Nitrous Oxide','primary_energy_consumption':'Primary Energy Consumption','total_ghg':'Total Greenhouse Gas'})
In [32]:
fig=px.imshow(world_cond.corr(),text_auto=True, zmin=-1, zmax=1, origin=0,
              title="<b>Relationship Between GHG Emissions and MacroEcomic Factors</b>")
fig.update_layout(width=1000,height=900)
fig.update_annotations(font_size=1000)
fig.show()
10.85278660.8429770.7365590.97624440.97137590.86776340.94538660.852786610.95471760.96059870.94461960.95661280.97371330.97675360.8429770.954717610.94837660.9471140.95687810.9961160.9912280.7365590.96059870.948376610.86438620.88358620.97170980.92626650.97624440.94461960.9471140.864386210.9937210.93340080.9783660.97137590.95661280.95687810.88358620.99372110.94574020.9837610.86776340.97371330.9961160.97170980.93340080.945740210.9831940.94538660.97675360.9912280.92626650.9783660.9837610.9831941PopulationGDPCarbon(iv)oxideCumulative Carbon(iv)oxideMethaneNitrous OxidePrimary Energy ConsumptionTotal Greenhouse GasTotal Greenhouse GasPrimary Energy ConsumptionNitrous OxideMethaneCumulative Carbon(iv)oxideCarbon(iv)oxideGDPPopulation−1−0.500.51Relationship Between GHG Emissions and MacroEcomic Factors

Overall, we see that GHG emissions are strongly correlated with macroeconomic factors such as GDP and population.

Limitations

  • Presence of missing data which were mostly ignored
  • 2020 methane data was not available for analysis
  • There was missiong emissions data for some ZRF Endorsers

Conclusion

  • We've seen different trends exist in the CO2 emissions of different continent and an opposing trend is seen in the per capita CO2 emissions. This mismatch also exist in the CO2, per capita CO2 emissions and cumulative CO2 emissions.
  • In the progression of various members of OPEC, OPEC+ and ZRF Endorsers, we see that some countries are still falling short on their commitment and haven't taken necessary actions with regards their co2, flaring and methane emissions.
In [34]:
%%shell
jupyter nbconvert --to html Copy_of_Untitled16.ipynb
[NbConvertApp] Converting notebook Copy_of_Untitled16.ipynb to html
[NbConvertApp] Writing 4363231 bytes to Copy_of_Untitled16.html
Out[34]:

In [ ]: